unit uDataAccessObjectPoolFactory;

interface

uses
  SysUtils, uObjectPool_Impl, uDataAccessObject, uDataAccessObject_ADO, uServiceLocator_Intf;

type
  TADODataAccessObjectPoolFactory = class;
  TADODataAccessObjectPoolFactory = class(TBasePoolableObjectFactory)
  public
    procedure DestroyObject(AObject: TObject); override; stdcall;
    function MakeObject: TObject; override; stdcall;
  end;

implementation

{ TADODataAccessObjectPoolFactory }

{
*********************** TADODataAccessObjectPoolFactory ************************
}
procedure TADODataAccessObjectPoolFactory.DestroyObject(AObject: TObject);
begin
  AObject.Free;
end;

function TADODataAccessObjectPoolFactory.MakeObject: TObject;
begin
  Result:= TDataAccessObject_ADO.Create(nil);
  ServiceLocator.LogManager.Log(Format('Through TADODataAccessObjectPoolFactory create TDataAccessObject_ADO #%d', [Integer(Result)]));
end;

end.
